<!DOCTYPE html>
<html lang="en">

<head>
    <base href="/">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Toyqo - Kids Store Bootstrap 5 Template</title>

    <!-- Favicons -->
    <link rel="stylesheet" href="layui/css/layui.css">

    <!-- Vendor CSS (Icon Font) -->

    <link rel="stylesheet" href="front/css/fontawesome.min.css">
    <link rel="stylesheet" href="front/css/pe-icon-7-stroke.min.css">


    <!-- Plugins CSS (All Plugins Files) -->


    <link rel="stylesheet" href="front/css/swiper-bundle.min.css">
    <link rel="stylesheet" href="front/css/animate.min.css">
    <link rel="stylesheet" href="front/css/lightgallery.min.css">
    <link rel="stylesheet" href="front/css/aos.min.css">
    <link rel="stylesheet" href="front/css/nice-select.min.css">


    <!-- Main Style CSS -->
    <link rel="stylesheet" href="front/css/style.css">


    <!-- Use the minified version files listed below for better performance and remove the files listed above -->

    <!--
<link rel="stylesheet" href="assets/css/vendor/vendor.min.css">
<link rel="stylesheet" href="assets/css/plugins/plugins.min.css">
<link rel="stylesheet" href="assets/css/style.min.css"> 
-->
    <style>
        .btn-action {
            padding: 8px 20px;
            margin-left: 10px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-weight: bold;
        }

        .btn-primary {
            background-color: #00c4cc;
            color: white;
        }
        .order-timeline {
            margin: 30px 0;
            position: relative;
        }

        .timeline-track {
            position: absolute;
            top: 30px;
            left: 0;
            width: 100%;
            height: 4px;
            background-color: #eee;
            z-index: 1;
        }

        .timeline-progress {
            position: absolute;
            top: 30px;
            left: 0;
            height: 4px;
            background-color: #00c4cc;
            z-index: 2;
        }

        .timeline-steps {
            display: flex;
            justify-content: space-between;
            position: relative;
            z-index: 3;
        }

        .timeline-step {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 20%;
        }

        .step-icon {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background-color: #eee;
            display: flex;
            justify-content: center;
            align-items: center;
            margin-bottom: 10px;
        }

        .step-active .step-icon {
            background-color: #00c4cc;
            color: white;
        }

        .step-label {
            text-align: center;
            font-size: 14px;
            color: #666;
        }

        .step-active .step-label {
            color: #00c4cc;
            font-weight: bold;
        }
    </style>
</head>

<body>
    <input type="hidden" id="userId" th:value="${session.SHOPPING_LOGIN_USER?.id?:'null'}">

    <div class="header section">

        <!-- Header Top Start -->
        <div class="header-top bg-primary">
            <div class="container">
                <div class="row align-items-center">

                    <!-- Header Top Message Start -->
                    <div class="col-12">
                        <div class="header-top-msg-wrapper text-center">
                            <p class="header-top-message text-center">最高50%折扣 <strong>冬季</strong> 系列 <a href="page/shoppage" class="btn btn-hover-dark btn-secondary">立即购买</a></p>
                            <div class="header-top-close-btn">
                                <button class="top-close-btn"><i class="pe-7s-close"></i></button>
                            </div>
                        </div>
                    </div>
                    <!-- Header Top Message End -->
                </div>
            </div>
        </div>
        <!-- Header Top End -->

        <!-- Header Bottom Start -->
        <div class="header-bottom">
            <div class="header-sticky">
                <div class="container">
                    <div class="row align-items-center position-relative">

                        <!-- Header Logo Start -->
                        <div class="col-md-6 col-lg-3 col-xl-2 col-6">
                            <div class="header-logo">
                                <a href="page/shoppage"><img src="front/picture/logo.png" alt="Site Logo"></a>
                            </div>
                        </div>
                        <!-- Header Logo End -->

                        <!-- Header Menu Start -->
                        <div class="col-lg-6 d-none d-lg-block">

                            <div class="main-menu">
                                <ul>
                                    <li class="has-children">
                                        <a href="page/index">首页</a>
                                    </li>
                                    <li class="has-children position-static">
                                        <a href="page/shoppage">购物</a>
                                    </li>
                                    <li><a href="page/about">关于我们</a></li>
                                    <li><a href="page/contact">联系我们</a></li>
                                </ul>
                            </div>

                        </div>
                        <!-- Header Menu End -->

                        <!-- Header Action Start -->
                        <div class="col-md-6 col-lg-3 col-xl-4 col-6 justify-content-end">
                            <div class="header-actions">
                                <div class="dropdown-user d-none d-lg-block">
                                    <a href="page/account" class="header-action-btn"><i class="pe-7s-user"></i></a>
                                </div>
                                <a href="page/wishlist" class="header-action-btn header-action-btn-wishlist">
                                    <i class="pe-7s-like"></i>
                                </a>
                                <a href="page/cart" class="header-action-btn header-action-btn-cart">
                                    <i class="pe-7s-cart"></i>
                                </a>
                                <!-- Mobile Menu Hambarger Action Button Start -->
                                <a href="javascript:void(0)" class="header-action-btn header-action-btn-menu d-lg-none d-md-block">
                                    <i class="fa fa-bars"></i>
                                </a>
                                <!-- Mobile Menu Hambarger Action Button End -->

                            </div>
                        </div>
                        <!-- Header Action End -->

                    </div>
                </div>
            </div>
        </div>
        <!-- Header Bottom End -->

        <!-- Offcanvas Search Start -->
        <div class="offcanvas-search">
            <div class="offcanvas-search-inner">

                <!-- Button Close Start -->
                <div class="offcanvas-btn-close">
                    <i class="pe-7s-close"></i>
                </div>
                <!-- Button Close End -->

                <!-- Offcanvas Search Form Start -->
                <form class="offcanvas-search-form" action="#">
                    <input type="text" placeholder="Search Product..." class="offcanvas-search-input">
                </form>
                <!-- Offcanvas Search Form End -->

            </div>
        </div>
        <!-- Offcanvas Search End -->

    </div>
    <!-- Header Section End -->


    <!-- Breadcrumb Section Start -->
    <div class="section">

        <!-- Breadcrumb Area Start -->
        <div class="breadcrumb-area bg-primary">
            <div class="container">
                <div class="breadcrumb-content">
                    <ul>
                        <li>
                            <a href="index.html"><i class="fa fa-home"></i> </a>
                        </li>
                        <li class="active"> 历史订单 页面</li>
                    </ul>
                </div>
            </div>
        </div>
        <!-- Breadcrumb Area End -->

    </div>
    <!-- Breadcrumb Section End -->

    <!-- Checkout Section Start -->
    <div class="section section-margin">
        <div class="container">
            <div class="row mb-n4">
                <div class="col-lg-6 col-12 mb-4">
                    <div>
                        <span>订单状态：</span><span id="order-status" style="font-size: 20px;"></span>
                        <button class="btn-action btn-primary" id="btn-confirm-receipt" style="display: none;">确认收货</button>
                    </div>
                    <div class="order-timeline">
                        <div class="timeline-track"></div>
                        <div class="timeline-progress" id="timeline-progress"></div>
                        <div class="timeline-steps" >
                            <div class="timeline-step" id="step-order">
                                <div class="step-icon"><i class="fa fa-check"></i></div>
                                <div class="step-label">已生成订单</div>
                            </div>
                            <div class="timeline-step" id="step-payment">
                                <div class="step-icon"><i class="fa fa-exclamation-circle"></i></div>
                                <div class="step-label">未支付</div>
                            </div>
                            <div class="timeline-step" id="step-shipping">
                                <div class="step-icon"><i class="fa fa-credit-card"></i></div>
                                <div class="step-label">已支付</div>
                            </div>
                            <div class="timeline-step" id="step-received">
                                <div class="step-icon"><i class="fa fa-truck"></i></div>
                                <div class="step-label">已发货</div>
                            </div>
                            <div class="timeline-step" id="step-review">
                                <div class="step-icon"><i class="fa fa-home"></i></div>
                                <div class="step-label">已收货</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row mb-n4">
                <div class="col-lg-6 col-12 mb-4">

                    <!-- Your Order Area Start -->
                    <div class="your-order-area border">

                        <!-- Title Start -->
                        <h3 class="title">您的订单</h3>
                        <!-- Title End -->

                        <!-- Your Order Table Start -->
                        <div class="your-order-table table-responsive">
                            <table class="table">

                                <!-- Table Head Start -->
                                <thead>
                                    <tr class="cart-product-head">
                                        <th class="cart-product-name text-start">商品</th>
                                        <th class="cart-product-total text-end">总价</th>
                                    </tr>
                                </thead>
                                <!-- Table Head End -->

                                <!-- Table Body Start -->
                                <tbody id="orderlist">

                                </tbody>
                                <!-- Table Body End -->

                                <!-- Table Footer Start -->
                                <tfoot>
                                    <tr class="order-total">
                                        <th class="text-start ps-0"><strong>订单总价</strong></th>
                                        <td class="text-end pe-0"><strong><span class="amount totalprice">$0.00</span></strong></td>
                                    </tr>
                                </tfoot>
                                <!-- Table Footer End -->

                            </table>
                        </div>
                        <!-- Your Order Table End -->
                    </div>
                    <!-- Your Order Area End -->
                </div>
                <div class="col-lg-6 col-12 mb-4">
                    <div class="your-order-area border">
                        <h3 class="title">收货信息</h3>
                        <!-- Title End -->

                        <!-- Your Order Table Start -->
                        <div class="your-order-table table-responsive">
                            <table class="table">
                                <tbody >
                                <tr class="cart_item">
                                    <td class="cart-product-name text-start ps-0">收货人：</td>
                                    <td id="receivername" class="cart-product-total text-end pe-0">张三</td>
                                </tr>
                                <tr class="cart_item">
                                    <td class="cart-product-name text-start ps-0">手机号码：</td>
                                    <td id="receiverphone" class="cart-product-total text-end pe-0">123456</td>
                                </tr>
                                <tr class="cart_item">
                                    <td class="cart-product-name text-start ps-0">收货地址：</td>
                                    <td id="receiveraddress" class="cart-product-total text-end pe-0">北京市/东城区/001号</td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <!-- Your Order Table End -->

                        <!-- Your Order Table End -->
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- Checkout Section End -->

    <!-- Footer Section Start -->
    <footer class="section footer-section">
        <!-- Footer Top Start -->
        <div class="footer-top bg-primary section-padding">
            <div class="container">
                <div class="row mb-n8">
                    <div class="col-12 col-sm-6 col-lg-3 mb-8">
                        <div class="single-footer-widget">
                            <h1 class="widget-title">About Us</h1>
                            <p class="desc-content">We are a team of designers and developers that create high quality wordpress, shopify, Opencart</p>
                            <!-- Soclial Link Start -->
                            <div class="widget-social justify-content-start mb-n2">
                                <a title="Facebook" href="#"><i class="fa fa-facebook-f"></i></a>
                                <a title="Twitter" href="#"><i class="fa fa-twitter"></i></a>
                                <a title="Linkedin" href="#"><i class="fa fa-linkedin"></i></a>
                                <a title="Youtube" href="#"><i class="fa fa-youtube"></i></a>
                                <a title="Vimeo" href="#"><i class="fa fa-vimeo"></i></a>
                            </div>
                            <!-- Social Link End -->
                        </div>
                    </div>
                    <div class="col-12 col-sm-6 col-lg-3 mb-8">
                        <div class="single-footer-widget">
                            <h2 class="widget-title">Contact Us</h2>
                            <ul class="contact-links">
                                <li><i class="pe-7s-home"></i> <span>Your address goes here</span> </li>
                                <li><i class="pe-7s-mail"></i><a href="mailto:info@example.com"> info@example.com</a></li>
                                <li><i class="pe-7s-call"></i><a href="tel:+012-3456-789"> +012 3456 789</a></li>
                            </ul>
                        </div>
                    </div>
                    <div class="col-12 col-sm-6 col-lg-3 mb-8">
                        <div class="single-footer-widget aos-init aos-animate">
                            <h2 class="widget-title">Information</h2>
                            <ul class="widget-list">
                                <li><a href="contact.html">Terms & Conditions</a></li>
                                <li><a href="contact.html">Payment Methode</a></li>
                                <li><a href="contact.html">Product Warranty</a></li>
                                <li><a href="contact.html">Return Process</a></li>
                                <li><a href="contact.html">Payment Security</a></li>
                            </ul>
                        </div>
                    </div>
                    <div class="col-12 col-sm-6 col-lg-3 mb-8">
                        <div class="single-footer-widget">
                            <h2 class="widget-title">Signup for newsletter</h2>
                            <div class="widget-body">
                                <!-- Newsletter Form Start -->
                                <div class="newsletter-form-wrap pt-1">
                                    <form id="mc-form" class="mc-form">
                                        <input type="email" id="mc-email" class="form-control email-box mb-4" placeholder="demo@example.com" name="EMAIL">
                                        <button id="mc-submit" class="newsletter-btn" type="submit">Subscribe</button>
                                    </form>
                                    <!-- mailchimp-alerts Start -->
                                    <div class="mailchimp-alerts text-centre">
                                        <div class="mailchimp-submitting"></div><!-- mailchimp-submitting end -->
                                        <div class="mailchimp-success text-success"></div><!-- mailchimp-success end -->
                                        <div class="mailchimp-error text-danger"></div><!-- mailchimp-error end -->
                                    </div>
                                    <!-- mailchimp-alerts end -->
                                </div>
                                <!-- Newsletter Form End -->
                                <p class="desc-content mb-0">Join over 1,000 people who get free and fresh content delivered automatically each time we publish</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Footer Top End -->

        <!-- Footer Bottom Start -->
        <div class="footer-bottom bg-secondary pt-4 pb-4">
            <div class="container">
                <div class="row align-items-center">
                    <div class="col-12 text-center">
                        <div class="copyright-content">
                            <p class="mb-0">Copyright &copy; 2023.Company name All rights reserved.<a target="_blank" href="https://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a></p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Footer Bottom End -->
    </footer>
    <!-- Footer Section End -->


    <a href="#" class="scroll-top show" id="scroll-top">
        <i class="arrow-top pe-7s-angle-up-circle"></i>
        <i class="arrow-bottom pe-7s-angle-up-circle"></i>
    </a>

    <!-- Mobile Menu Start -->
    <div class="mobile-menu-wrapper">
        <div class="offcanvas-overlay"></div>

        <!-- Mobile Menu Inner Start -->
        <div class="mobile-menu-inner">

            <!-- Button Close Start -->
            <div class="offcanvas-btn-close">
                <i class="pe-7s-close"></i>
            </div>
            <!-- Button Close End -->

            <!-- Mobile Menu Inner Wrapper Start -->
            <div class="mobile-menu-inner-wrapper">
                <!-- Mobile Menu Search Box Start -->
                <div class="search-box-offcanvas">
                    <form>
                        <input class="search-input-offcanvas" type="text" placeholder="Search product...">
                        <button class="search-btn"><i class="pe-7s-search"></i></button>
                    </form>
                </div>
                <!-- Mobile Menu Search Box End -->

                <!-- Mobile Menu Start -->
                <div class="mobile-navigation">
                    <nav>
                        <ul class="mobile-menu">
                            <li class="has-children">
                                <a href="#">Home <i class="fa fa-angle-down"></i></a>
                                <ul class="dropdown">
                                    <li><a href="index.html">Home One</a></li>
                                    <li><a href="index-2.html">Home Two</a></li>
                                    <li><a href="index-3.html">Home Three</a></li>
                                </ul>
                            </li>
                            <li class="has-children">
                                <a href="#">Shop <i class="fa fa-angle-down" aria-hidden="true"></i></a>
                                <ul class="dropdown">
                                    <li><a href="shop.html">Shop Grid</a></li>
                                    <li><a href="shop-left-sidebar.html">Shop Left Sidebar</a></li>
                                    <li><a href="shop-right-sidebar.html">Shop Right Sidebar</a></li>
                                    <li><a href="shop-list-fullwidth.html">Shop List Fullwidth</a></li>
                                    <li><a href="shop-list-left-sidebar.html">Shop List Left Sidebar</a></li>
                                    <li><a href="shop-list-right-sidebar.html">Shop List Right Sidebar</a></li>
                                    <li><a href="wishlist.html">Wishlist</a></li>
                                    <li><a href="cart.html">Shopping Cart</a></li>
                                    <li><a href="">Checkout</a></li>
                                    <li><a href="compare.html">Compare</a></li>
                                </ul>
                            </li>
                            <li class="has-children">
                                <a href="#">Product <i class="fa fa-angle-down" aria-hidden="true"></i></a>
                                <ul class="dropdown">
                                    <li><a href="single-product.html">Single Product</a></li>
                                    <li><a href="single-product-sale.html">Single Product Sale</a></li>
                                    <li><a href="single-product-group.html">Single Product Group</a></li>
                                    <li><a href="single-product-normal.html">Single Product Normal</a></li>
                                    <li><a href="single-product-affiliate.html">Single Product Affiliate</a></li>
                                    <li><a href="single-product-slider.html">Single Product Slider</a></li>
                                    <li><a href="single-product-gallery-left.html">Gallery Left</a></li>
                                    <li><a href="single-product-gallery-right.html">Gallery Right</a></li>
                                    <li><a href="single-product-tab-style-left.html">Tab Style Left</a></li>
                                    <li><a href="single-product-tab-style-right.html">Tab Style Right</a></li>
                                    <li><a href="single-product-sticky-left.html">Sticky Left</a></li>
                                    <li><a href="single-product-sticky-right.html">Sticky Right</a></li>
                                </ul>
                            </li>
                            <li class="has-children">
                                <a href="#">Pages <i class="fa fa-angle-down" aria-hidden="true"></i></a>
                                <ul class="dropdown">
                                    <li><a href="about.html">About Us</a></li>
                                    <li><a href="contact.html">Contact</a></li>
                                    <li><a href="faq.html">Faq</a></li>
                                    <li><a href="error-404.html">Error 404</a></li>
                                    <li><a href="my-account.html">My Account</a></li>
                                    <li><a href="login.html">Loging | Register</a></li>
                                </ul>
                            </li>
                            <li class="has-children">
                                <a href="#">Blog <i class="fa fa-angle-down" aria-hidden="true"></i></a>
                                <ul class="dropdown">
                                    <li><a href="blog.html">Blog</a></li>
                                    <li><a href="blog-left-sidebar.html">Blog Left Sidebar</a></li>
                                    <li><a href="blog-right-sidebar.html">Blog Right Sidebar</a></li>
                                    <li><a href="blog-details.html">Blog Details</a></li>
                                    <li><a href="blog-details-sidebar.html">Blog Details Sidebar</a></li>
                                </ul>
                            </li>
                            <li><a href="about.html">About</a></li>
                            <li><a href="contact.html">Contact</a></li>
                        </ul>
                    </nav>
                </div>
                <!-- Mobile Menu End -->

                <!-- Language, Currency & Link Start -->
                <div class="offcanvas-lag-curr mb-6">
                    <div class="header-top-lan-curr-link">
                        <div class="header-top-lan dropdown">
                            <h4 class="title">Language:</h4>
                            <button class="dropdown-toggle" data-bs-toggle="dropdown">English <i class="fa fa-angle-down"></i></button>
                            <ul class="dropdown-menu dropdown-menu-right">
                                <li><a class="dropdown-item" href="#">English</a></li>
                                <li><a class="dropdown-item" href="#">Japanese</a></li>
                                <li><a class="dropdown-item" href="#">Arabic</a></li>
                                <li><a class="dropdown-item" href="#">Romanian</a></li>
                            </ul>
                        </div>
                        <div class="header-top-curr dropdown">
                            <h4 class="title">Currency:</h4>
                            <button class="dropdown-toggle" data-bs-toggle="dropdown">USD <i class="fa fa-angle-down"></i></button>
                            <ul class="dropdown-menu dropdown-menu-right">
                                <li><a class="dropdown-item" href="#">USD</a></li>
                                <li><a class="dropdown-item" href="#">Pound</a></li>
                            </ul>
                        </div>
                    </div>
                </div>
                <!-- Language, Currency & Link End -->

                <!-- Contact Links/Social Links Start -->
                <div class="mt-auto bottom-0">

                    <!-- Contact Links Start -->
                    <ul class="contact-links">
                        <li><i class="fa fa-phone"></i><a href="#"> +012 3456 789</a></li>
                        <li><i class="fa fa-envelope-o"></i><a href="#"> info@example.com</a></li>
                        <li><i class="fa fa-clock-o"></i> <span>Monday - Sunday 9.00 - 18.00</span> </li>
                    </ul>
                    <!-- Contact Links End -->

                    <!-- Social Widget Start -->
                    <div class="widget-social">
                        <a title="Facebook" href="#"><i class="fa fa-facebook-f"></i></a>
                        <a title="Twitter" href="#"><i class="fa fa-twitter"></i></a>
                        <a title="Linkedin" href="#"><i class="fa fa-linkedin"></i></a>
                        <a title="Youtube" href="#"><i class="fa fa-youtube"></i></a>
                        <a title="Vimeo" href="#"><i class="fa fa-vimeo"></i></a>
                    </div>
                    <!-- Social Widget Ende -->
                </div>
                <!-- Contact Links/Social Links End -->
            </div>
            <!-- Mobile Menu Inner Wrapper End -->

        </div>
        <!-- Mobile Menu Inner End -->
    </div>
    <!-- Mobile Menu End -->

    <!-- Scripts -->
    <script src="layui/layui.all.js"></script>
    <script type="text/html" id="orderitem">
        <tr class="cart_item">
            <td class="cart-product-name text-start ps-0"> Some Winter Collections<strong
                class="product-quantity"> × 2</strong></td>
            <td class="cart-product-total text-end pe-0"><span class="amount">£145.00</span></td>
        </tr>
    </script>



    <script>
        const $ = layui.$;

        const urlParams = new URLSearchParams(window.location.search);
        const orderId = Number(urlParams.get('orderid'));
        //生成订单商品
        $.ajax({
            url: 'orderdetails/get',
            data: {orderid: orderId},
            success: function (result) {
                result.forEach(item => {
                    let $newRow = $('#orderitem').html()
                        .replace(' Some Winter Collections', item.thatproname)
                        .replace(' × 2', ' × ' + item.quantity)
                        .replace('£145.00', '$' + item.thatprice*item.quantity);
                    $('#orderlist').append($newRow);
                });
                updatetotalprice();
            }
        });
        //生成订单总价函数
        function updatetotalprice(){
            $.ajax({
                url:'orderdetails/sum',
                data:{orderid:orderId},
                success:function(result){
                    $('.totalprice').text('$'+result);
                }
            });
        }
        //生成收货信息
        $.ajax({
            url:'orderaddress/get',
            data:{orderid:orderId},
            success:function(result){
                $('#receiveraddress').text(result.receiveraddress);
                $('#receivername').text(result.receivername);
                $('#receiverphone').text(result.receiverphone);
            }
        });
        //生成订单状态
        getorderstatus();
        function getorderstatus(){
            $.ajax({
                url:'orders/getOrder',
                data:{orderid:orderId},
                success:function(result){
                    updateOrderStatus(result.status);
                    updateActionButtons(result.status);
                }
            });
        }
        //更新按钮状态
        function updateActionButtons(status) {
            const btnConfirmReceipt = $('#btn-confirm-receipt');
            // 默认隐藏所有按钮
            btnConfirmReceipt.hide();
            if(status=="已发货"){
                btnConfirmReceipt.show().off('click').on('click', function() {
                    confirmReceipt();
                });
            }
        }
        //收货
        // 确认收货
        function confirmReceipt() {
            layer.confirm('确认已收到商品吗？', {icon: 3, title:'提示'}, function(index){
                $.ajax({
                    url: 'orders/edit',
                    data: {id:orderId,status:"已收货",gettime:getCurrentDateTime(),endtime:getCurrentDateTime()},
                    success: function(){
                        layer.msg('已确认收货', {icon: 1});
                        setTimeout(() => {
                            getorderstatus();
                        }, 1500);
                    },
                    error: function(xhr, status, error) {
                        layer.msg('确认收货失败: ' + error, {icon: 2});
                    }
                });
                layer.close(index);
            });
        }

        // 更新订单状态显示
        function updateOrderStatus(status) {
            let statusText = '未知状态';
            let statusClass = '';
            let progressWidth = '0%';

            // 重置所有步骤
            $('.timeline-step').removeClass('step-active');

            switch (status) {
                case "已失效":
                    statusText = '已失效';
                    statusClass = 'status-cancelled';
                    // 不激活任何步骤
                    break;
                case "已生成订单":
                    statusText = '已生成订单';
                    statusClass = 'status-pending';
                    progressWidth = '20%';
                    $('#step-order').addClass('step-active');
                    break;
                case "未支付":
                    statusText = '未支付';
                    statusClass = 'status-processing';
                    progressWidth = '40%';
                    $('#step-order, #step-payment').addClass('step-active');
                    break;
                case "已支付":
                    statusText = '已支付';
                    statusClass = 'status-shipped';
                    progressWidth = '60%';
                    $('#step-order, #step-payment, #step-shipping').addClass('step-active');
                    break;
                case "已发货":
                    statusText = '已发货';
                    statusClass = 'status-completed';
                    progressWidth = '80%';
                    $('#step-order, #step-payment, #step-shipping, #step-received').addClass('step-active');
                    break;
                case "已收货":
                    statusText = '已收货';
                    statusClass = 'status-cancelled';
                    progressWidth = '100%';
                    $('#step-order, #step-payment, #step-shipping, #step-received, #step-review').addClass('step-active');
                    break;
            }

            // 更新状态显示
            const statusElement = $('#order-status');
            statusElement.text(statusText);

            // 更新进度条
            $('#timeline-progress').css('width', progressWidth);
        }
        //时间
        function getCurrentDateTime() {
            const now = new Date();

            const year = now.getFullYear();
            const month = String(now.getMonth() + 1).padStart(2, '0'); // 月份从0开始，所以需要加1
            const day = String(now.getDate()).padStart(2, '0');
            const hours = String(now.getHours()).padStart(2, '0');
            const minutes = String(now.getMinutes()).padStart(2, '0');
            const seconds = String(now.getSeconds()).padStart(2, '0');

            return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
        }
    </script>
    <!-- Global Vendor, plugins JS -->

    <!-- Vendor JS -->


    <script src="front/js/popper.min.js"></script>
    <script src="front/js/bootstrap.min.js"></script>
    <script src="front/js/jquery-3.6.0.min.js"></script>
    <script src="front/js/jquery-migrate-3.3.2.min.js"></script>
    <script src="front/js/modernizr-3.11.2.min.js"></script>


    <!-- Plugins JS -->


    <script src="front/js/aos.min.js"></script>
    <script src="front/js/jquery.ajaxchimp.min.js"></script>
    <script src="front/js/jquery-ui.min.js"></script>
    <script src="front/js/nice-select.min.js"></script>
    <script src="front/js/swiper-bundle.min.js"></script>
    <script src="front/js/countdown.min.js"></script>
    <script src="front/js/lightgallery-all.min.js"></script>



    <!-- Use the minified version files listed below for better performance and remove the files listed above -->


    <!-- 
    <script src="assets/js/vendor.min.js"></script>
    <script src="assets/js/plugins.min.js"></script> 
    -->

    <!--Main JS-->
    <script src="front/js/main.js"></script>
</body>

</html>